const query = require('../config/sql');
const { v4: uuidv4 } = require('uuid');

module.exports = async function createpermissions(id) {
    let permissionId = uuidv4();
    const sql = `insert into permissions(permissionId, user_id, publish, comment, approval) values(?,?,?,?,?);`
    await query(sql,[permissionId,id,1,1,1]).then(async (result) => {   
        return result.affectedRows == 1
    })
}